Repository navigation
AI Workspace: agent audit trail, chats in personal-data export and erase, Wapuu busy states - #1317
Conversation
Tool calls, approved items and proposal events (created, edited, declined, expired, failed, refused for a deleted chat) are each one `agent` row in the AI Request Log and one `wpai_agent_event` call, which fires whether or not AI Request Logging is on. The log screen gains the `denied` status, ported from #1214. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rase Tools → Export Personal Data gains an "AI chats" group: one item per chat, archived ones included, with its name, dates, archived flag and each turn's message and reply, paged at 20. Tools → Erase Personal Data deletes all of the person's chats. Both are hooked from Main, so they work while the experiment is off, and read chat IDs straight from the posts table, as the user-deletion cleanup does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The transcript's spinner becomes Jeff Paul's working Wapuu from #1287, with a done Wapuu for a moment after a turn finishes and an oops Wapuu beside an error. Each sprite is decorative, next to the existing status text, and is a still frame when reduced motion is on. The sprites are derived from Kazuko Kaneuchi's original Wapuu (GPL-2.0-or-later), credited in CREDITS.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… expiry Agent rows carry no request kind, so the log screen labelled them Text. They now read Agent. The tool-call docblock no longer says rows are of the ability type, and an expired proposal read through the store is tested to record one expired event. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The short-search test searched for "q", which matches "AI Request Logs" once AI Request Logging is on, as it is after that spec runs in the same session. It now searches for "~" and "~^". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feat/agent-command-palette #1317 +/- ##
================================================================
+ Coverage 86.77% 86.81% +0.04%
- Complexity 6282 6330 +48
================================================================
Files 224 226 +2
Lines 22769 22901 +132
================================================================
+ Hits 19758 19882 +124
- Misses 3011 3019 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jeffpaul
left a comment
There was a problem hiding this comment.
Sprites: working while a turn runs, celebrating for 1.8 seconds after one finishes, and oops next to an error. They come from the set @jeffpaul posted on #1287.
Scope: only busy, done and error states ship. Per-tool sprites need streaming to know which tool is running.
Safe to assume that the other sprites are still available, mainly for scenarios where another plugin might provide function where they'd come into use (or perhaps once core/AI client provides streaming or other functions so those additional sprites can be rendered)?
|
Yes. The full set stays in your post on #1287; this PR only ships busy, done and error. The others can come in when there's something to show them for, such as streaming that names the tool running, or another plugin's abilities. AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for: drafting this reply. I've reviewed the changes, understand them and can explain them under review. |
## What? Related: #1287 The docs pass for the #1287 stack. AI Workspace keeps its name and is documented as the plugin's one agent. The experiment doc, `readme.txt`, `README.md`, the changelog and the settings card now describe what #1314 to #1317 added. No code paths change. This is the fifth and last stacked PR for #1287, on top of #1317, #1316, #1315 and #1314. ## Why? #1287 folds two planned experiments into AI Workspace: Site Agent (#1214) and Command Palette AI Search (#1250). A reader of the docs, readme or changelog should learn that from them. Before this, the settings card and readme still described a workspace that only creates drafts and templates. The changelog had nothing for the write, palette, audit, privacy or Wapuu changes, `README.md` had no AI Workspace entry at all, and "Site Agent" was still listed under Coming Soon. ## How? - **`docs/experiments/ai-workspace.md`** - The summary and key features cover changes to existing content, site answers and screen links, the chats panel, the Wapuu, the audit log and personal-data export. - A new "One agent" section says what Site Agent and Command Palette AI Search proposed and where each now lives. It also says that the name, menu, URL and every identifier, including the experiment ID `ai-workspace`, are unchanged. - The entry-points list names every ability the experiment registers, and `Conversation_Privacy`. - A stale limitation is removed. It said chats have no history screen, but the chats panel ships. - **`readme.txt` and `CHANGELOG.md`** - Added: changes to existing content, the palette's AI search and Ask AI, the `agent` log rows, chats in export and erase, and the Wapuu. - Developer: `wpai_agent_event`, the two new proposal filters, the MCP visibility change, `raw: true`, and the `ability` to `agent` log type change. - `CHANGELOG.md` also gains the two ability lines #1315 added only to `readme.txt`. - **`README.md`:** adds the missing AI Workspace entry. - **Both readme files:** "Site Agent" leaves Coming Soon. - **Settings card:** the AI Workspace description says it answers site questions, proposes changes to posts and the site title and tagline, and adds AI to the command palette. The name stays "AI Workspace". Nothing on #1287 has settled on another name. ### Use of AI Tools AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for: writing the documentation and changelog entries, checking them against the code, and code review. I've reviewed the changes, understand them and can explain them under review. They have all been tested locally. ## Testing Instructions 1. Open Settings → AI. The AI Workspace card reads as in the screenshot below. 2. Read `docs/experiments/ai-workspace.md` → "One agent", and the Unreleased changelog in `readme.txt` and `CHANGELOG.md`. **Tests run** (all passing): - **PHPUnit, full suite:** 3398 tests, single site and multisite, on WordPress latest. Only the settings-card string is code, and no test asserts it. - **Other checks:** phpcs and `php -l` are clean on `AI_Workspace.php`. - **Name check:** a grep for "Site Agent" and "Wordspace" across `includes/`, `src/` and the built assets finds nothing user-visible. - **Claims checked against the code:** - the abilities `AI_Workspace::register()` registers; - `meta.mcp.public` false on the propose and ask-user abilities; - the `wpai_workspace_write_proposals_enabled` and `wpai_workspace_proposal_kinds` filters; - `raw` on `ai/read-content-bodies`; - the chats panel's rename, archive and delete actions; - the three in-page anchors the doc links to. - **Not run:** e2e. No script, style or behavior changes. **Code review:** `ce-code-review` sized this diff to a single-context review: 51 changed lines, two of them code. It found nothing and gave "Ready to merge". Its one residual is applied in 0b06540: the doc's feature bullet now says rows are written while AI Request Logging is on. ## Screenshots **The settings card**  ## Known limits - The changelog lines for #1314, #1316 and #1317 are added here rather than in those PRs, so they land only when this one merges after them. ## Changelog Entry > Changed - AI Workspace is documented as the plugin's one agent: it now includes what the Site Agent and Command Palette AI Search proposals planned, under its existing name. **Post-deploy monitoring:** no additional operational monitoring is required. Documentation and one settings-card string. --- [](https://github.com/EveryInc/compound-engineering-plugin) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- wp-playground-preview:start --> <a href="https://playground.wordpress.net?blueprint-url=data:application/json,%7B%22preferredVersions%22%3A%7B%22wp%22%3A%22latest%22%7D%2C%22login%22%3Atrue%2C%22landingPage%22%3A%22%2Fwp-admin%2Fadmin.php%3Fpage%3Dai-wp-admin%22%2C%22steps%22%3A%5B%7B%22step%22%3A%22installPlugin%22%2C%22pluginData%22%3A%7B%22resource%22%3A%22url%22%2C%22url%22%3A%22https%3A%2F%2Fgithub.com%2FWordPress%2Fai%2Freleases%2Fdownload%2Fci-artifacts%2Fpr-1318-aa0faf515572fcec68b35f0b8a0634d387875fd1.zip%22%7D%7D%5D%7D" target="_blank" rel="noopener noreferrer"> <img src="https://raw.githubusercontent.com/adamziel/playground-preview/refs/heads/trunk/assets/playground-preview-button.svg" alt="Open WordPress Playground Preview" width="220" height="57" /> </a> <!-- wp-playground-preview:end --> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

What?
Related: #1287
The AI Workspace gains an audit trail, personal-data export and erase, and Wapuu busy states:
agentrow in the AI Request Log and one call of a newwpai_agent_eventaction. Events are tool calls (including withheld ones), each item an approval writes, and each step in a proposal's life: created, edited, declined, expired, failed, or refused because its chat was deleted. The action fires even when AI Request Logging is off.This is the fourth stacked PR for #1287, on top of #1316, #1315 and #1314.
Why?
#1287 asks that a site owner can see everything the agent did, was asked and was refused, in one place, and that audit plugins can hook it. Before this, workspace rows were mixed in with every other
abilityrow, proposal events weren't logged at all, and nothing fired with logging off. Saved chats are personal data that core's export and erase tools didn't know about. And Jeff posted a Wapuu set on #1287 so a long turn looks busy rather than stuck.How?
Agent_Auditis the one place agent events are recorded.wpai_agent_event( $operation, $status, $context, $error ), then writes the row throughlog_ai_request()with the newagenttype.Turn_Runnerand for written items inProposal_Writes, now go through it. Proposal events are recorded inProposal_StoreandProposal_Controller:deniedstatus, ported from Feature : Site Agent Experiment #1214, and agent rows are labelled "Agent". Rows logged before this keep theabilitytype.wp_after_execute_abilitylistener isn't ported:Turn_Runneralready logs each call, so it would log them twice.Conversation_Privacyregisters an "AI chats" exporter and eraser.Main, next to the chat ownership filter, so they work while the experiment is off.Conversation_Store::chat_ids().Wapuu sprites replace the transcript's spinner.
workingwhile a turn runs,celebratingfor 1.8 seconds after one finishes, andoopsnext to an error. They come from the set @jeffpaul posted on New Experiment: One AI agent across wp-admin #1287.<img alt="">. The existing "Responding…" text and error text stay as the status.<img>doesn't reliably follow the page's setting. So with reduced motion on, the component switches each sprite's animations off in its markup, which gives the same still pose.CREDITS.md.Use of AI Tools
AI assistance: Yes. Tool(s): Claude Code (Claude Opus 5.5). Used for: implementing the changes and tests, and code review.
I've reviewed the changes, understand them and can explain them under review. They have all been tested locally.
Testing Instructions
agent. The tool calls,proposal_created,proposal_editedandproposal_declinedrows are there, none of them with the tagline's text.Tests run (all passing):
Agent_AuditTest:test_agent_is_a_log_type,test_an_event_writes_one_row_and_fires_the_hook,test_the_hook_fires_with_logging_off,test_a_proposal_event_names_the_proposal_and_its_items_onlyandtest_a_proposal_without_a_kind_is_recorded_as_drafts.Proposal_ControllerTest:test_each_proposal_event_is_recorded_once_in_order,test_events_fire_the_hook_with_logging_off,test_an_expired_proposal_is_recorded_once,test_an_expired_proposal_read_through_the_store_is_recorded_once,test_an_interrupted_write_is_recorded_failed_once,test_a_writer_that_throws_is_recorded_failedandtest_an_approval_for_a_deleted_chat_is_recorded_denied.Turn_ControllerTest:test_a_turn_records_a_withheld_call_and_a_proposal_in_order, andtest_every_tool_call_writes_exactly_one_log_rowupdated for theagenttype.Post_Field_ProposalTest:test_a_content_update_records_the_field_not_the_content.AI_Request_Log_ControllerTest:test_get_logs_filters_agent_rows_by_type_and_denied_status.Conversation_PrivacyTest:test_the_exporter_and_eraser_are_registered_without_the_experiment,test_export_returns_every_chat_with_its_prompts_and_replies,test_export_with_the_experiment_off_includes_archived_chats,test_export_pages_at_twenty_chats,test_erase_removes_the_persons_chats_only,test_a_proposal_in_an_erased_chat_cannot_be_approvedandtest_an_unknown_email_exports_and_erases_nothing.ai-workspace*specs, the palette spec and the request-log spec, 168 passed in one run on a fresh site. That includes the new "AI Workspace Wapuu" tests inai-workspace.spec.js: a running turn shows the busy Wapuu beside "Responding…"; with reduced motion the busy Wapuu is a still frame; a failed turn shows the error Wapuu with the error; a finished turn shows the done Wapuu briefly. Each Wapuu test also ran three more times, 12 of 12 passing.Agent_Auditexisted. The privacy tests were written beforeConversation_Privacybut first run after it, so they have no recorded red run.ai-request-logs/index.scssandai-workspace/index.scssthat are already on the base branch.Code review: seven reviewers ran on this PR's own diff (correctness, security, adversarial, testing, maintainability, frontend races and API contract), plus an independent validator. The verdict was "Ready to merge" with no actionable findings. The one candidate, that the status filter rejects
skipped, was rejected because it's already on the base branch. Applied afterwards in eef886a: agent rows were labelled "Text" on the log screen, a docblock still said these rows use theabilitytype, and the store's expiry path had no test.One test from #1316 hardened (1060833): its short palette search for "q" matched "AI Request Logs" whenever AI Request Logging was on, which the request-log spec leaves on when both run in one session. It now searches for "~".
Screenshots
A running turn
A finished turn
A failed turn
Agent events in the AI Request Log
AI chats in a personal-data export
Known limits
wpai_agent_eventlistener that throws during an approval write marks the proposal failed, as any WordPress hook would. The hook isn't wrapped.skipped, which item rows have used since before this PR.agent, notability, so a view filtered toabilityno longer shows them.Changelog Entry
Post-deploy monitoring: no additional operational monitoring is required. This is an experiment behind the AI Workspace toggle, off by default. The exporter and eraser run only when an administrator processes a personal-data request.
🤖 Generated with Claude Code